<template>
  <div>
    <ant-modal
      modalWidth="800"
      modalHeight="550"
      :visible="open"
      :modal-title="formTitle"
      :adjust-size="true"
      @cancel="cancel"
    >
      <a-form-model
        ref="form"
        :model="form"
        :rules="rules"
        slot="content"
        layout="vertical"
      >
        <a-row :gutter="32" style="width: 60%; margin-left: 20%">
          <a-col :span="12">
            <a-form-model-item label="员工姓名" prop="yuangongName">
              <a-input
                v-model="form.yuangongName"
                placeholder="请输入员工姓名"
                @focus="handleOpenUser"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="工资类型" prop="type">
              <a-select
                placeholder="请选择工资类型"
                v-model="form.type"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body;
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option
                  v-for="(d, index) in typeOptions"
                  :key="index"
                  :value="d.dictValue"
                  >{{ d.dictLabel }}</a-select-option
                >
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="底薪（元）" prop="basicSalary">
              <a-input-number
                v-model="form.basicSalary"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="提成(0.3即30%)" prop="draw">
              <a-input-number
                v-model="form.draw"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="分润比例(0.3即30%)" prop="fenrunBi">
              <a-input-number
                v-model="form.fenrunBi"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="计件单价（元）" prop="jijianAmount">
              <a-input-number
                v-model="form.jijianAmount"
                :min="0"
                style="width: 100%"
              />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item label="状态" prop="status">
              <a-radio-group v-model="form.status" button-style="solid">
                <a-radio-button value="0"> 在职 </a-radio-button>
                <a-radio-button value="1"> 离职 </a-radio-button>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>

      <template slot="footer">
        <a-button @click="cancel"> 取消 </a-button>
        <a-button type="primary" @click="submitForm"> 保存 </a-button>
      </template>
    </ant-modal>

    <a-modal
      :visible="visible"
      title="选择员工"
      v-if="visible"
      width="65%"
      @ok="handleOk"
      @cancel="handleOk"
      :dialog-style="{ top: '10px' }"
      style="height: 60vh"
      :z-index="1002"
    >
      <change-user @getUser="handleManualShare" :isCheckBox="false" />
    </a-modal>
  </div>
</template>
<script>
import BizGongziSettingAddForm from "./BizGongziSettingForm";
export default {
  ...BizGongziSettingAddForm,
};
</script>
